local thbattle__xiangzi_huixiang = fk.CreateSkill {

  name = "thbattle__xiangzi_huixiang",

  tags = {},

}



thbattle__xiangzi_huixiang:addEffect(fk.Damaged, {
  prompt = "#thbattle__xiangzi_huixiang",
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(thbattle__xiangzi_huixiang.name) and data.card
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local target_p = player
    if data.card.trueName == "slash" then
      local players = table.map(room:getOtherPlayers(player), Util.IdMapper)
      local targets = room:askForChoosePlayers(player, players, 1, 1,
        "#thbattle__xiangzi_huixiang-choose_player", thbattle__xiangzi_huixiang.name, true)
      if #targets ~= 0 then
        target_p = room:getPlayerById(targets[1])
      end
    end
    room:obtainCard(target_p, data.card, true, fk.ReasonPrey, player, thbattle__xiangzi_huixiang.name)
  end,
})

return thbattle__xiangzi_huixiang
